<script type="text/javascript" src="java_scripts/vote_scripts.js"></script>
<html>
	<center>
		<b>List of Topics</b><br>
		<table border="1" cellpadding="0" cellspacing="0" width='700'>
			<tr align="center">
				<td>No.</td>
				<td>Description</td>
				<td>Amount of Items</td>
				<td>Duration(Months)</td>
				<td>Start Date</td>
				<td>End Date</td>
				<td>Edit | Remove</td>
			</tr>
			<?php 
				$i=0;
				foreach($topics->result_array() as $topic) {
				$i=$i+1;	
			?>
			<tr align="center">
				<td><?=$i?></td>
				<td><?=$topic['description']?></td>
				<td><?=$topic['item_amount']?></td>
				<td><?=$topic['duration']?></td>
				<td><?=$topic['start_date']?></td>
				<td><?=$topic['end_date']?></td>
				<td><a href="" style="text-decoration: none;color: blue;">Edit</a> | <span onclick="java:deleteTopic('<?=BASE_URL();?>vote_management/deleteTopic/<?=$topic['topic_id']?>');" style="cursor: pointer; color: blue;">Remove</span></td>
			</tr>
			<?php 
				}
			?>
		</table>
		<a href="<?=BASE_URL();?>vote_management/newTopic">Create a new Topic</a>
	</center>
</html>